<html>
	<title>To test associative array</title>
	<body>
	<?php
		$ipl_teams_captains['Chennai Super Kings'] = 'MS Dhoni';
		$ipl_teams_captains['Rajasthan Royals'] = 'Rahul Dravid';
		$ipl_teams_captains['Kolkata Knight Riders'] = 'Gautam Gambhir';
		$ipl_teams_captains['Royal Challengers Bangalore'] = 'Virat Kohli';
		$ipl_teams_captains['Delhi Daredevils'] = 'Mahela Jayawardene';
		$ipl_teams_captains['Kings XI Punjab'] = 'Adam Gilchrist';
		$ipl_teams_captains['Mumbai Indians'] = 'Rohit Sharma';
		$ipl_teams_captains['Pure Warriors India'] = 'Angelo Mathews';
		$ipl_teams_captains['Sunrisers Hyderabad'] = 'Kumar Sangakkara';
		
		foreach($ipl_teams_captains as $team => $captain){
		    echo "<b>$team</b>'s captain is <i><u>$captain</u></i> <br />";
		}
	
	        echo '<h3>To Display sorted values using asort function</h3>';
	        echo '<i>Following values are sorted based on the value of <br />
	              associative array, and the new object remains as associative array</i><br />';
	        asort($ipl_teams_captains);
	        echo '<p>';
	        foreach($ipl_teams_captains as $team => $captain){
		    echo "<b>$team</b>'s captain is <i><u>$captain</u></i> <br />";
		}
	        echo '</p>';

	        echo '<h3>To Display sorted values using sort function</h3>';
	        sort($ipl_teams_captains);
	        echo '<i>The associative array is converted into array having its values and <br />
	              sorted</i>';
	        echo '<p>';
	        foreach($ipl_teams_captains as $team => $captain){
		    echo "<b>$team</b>'s captain is <i><u>$captain</u></i> <br />";
		}
	        echo '</p>';
	
	?>
	</body>
</html>
